//
//  TabContainerViewController.m
//  JianChaRiBao
//
//  Created by yuzhou on 13-5-9.
//  Copyright (c) 2013年 wzyk. All rights reserved.
//

#import "TabContainerViewController.h"

@interface TabContainerViewController ()

@end

@implementation TabContainerViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
}

- (void)addChildViewController:(UIViewController *)childController
{
    [super addChildViewController:childController];
}

- (void)transitionFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL))completion
{
    if (self.currentViewController == nil) {
        toViewController.view.frame = self.view.bounds;
        [self.view addSubview:toViewController.view];
        self.currentViewController = toViewController;
        return;
    }
    if (self.currentViewController == toViewController) {
        return;
    }
    
    toViewController.view.frame = self.view.bounds;
    [super transitionFromViewController:fromViewController toViewController:toViewController duration:duration options:options animations:animations completion:completion];
    self.currentViewController = toViewController;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
